Skip to content

Fixed the issue of passport number mismatch - #301

Open
ubturja wants to merge 1 commit into
malaysia-ai:masterfrom
ubturja:fix/Passport-number-wrongly-expanded
Open

Fixed the issue of passport number mismatch#301
ubturja wants to merge 1 commit into
malaysia-ai:masterfrom
ubturja:fix/Passport-number-wrongly-expanded

Conversation

@ubturja

@ubturja ubturja commented Jul 21, 2026

Copy link
Copy Markdown
  1. malaya/text/regex.py: Replaced ^ and $ anchors with \b word boundaries in the _passport regex to allow mid-string matching while preventing partial word matches.
  2. malaya/normalizer/rules.py: Overhauled the passport condition formatting block. Letters are now preserved consecutively, while digits are expanded and safely padded with spaces. Post-processing cleans up excess whitespace, ensuring exact matching with expected TTS outputs.

Copilot AI review requested due to automatic review settings July 21, 2026 04:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@ubturja ubturja closed this Jul 21, 2026
@ubturja
ubturja deleted the fix/Passport-number-wrongly-expanded branch July 21, 2026 04:54
@ubturja
ubturja restored the fix/Passport-number-wrongly-expanded branch July 21, 2026 05:00
@ubturja ubturja reopened this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants